/*     */ package com.newcrm.thread;
/*     */ 
/*     */ import com.newcrm.util.Util;
/*     */ import java.io.File;
/*     */ import java.io.Serializable;
/*     */ import java.util.Timer;
/*     */ 
/*     */ public class BackgroundThreadManager
/*     */   implements Serializable
/*     */ {
/*     */   private static final long serialVersionUID = 2035902461782014027L;
/*     */   private static final long PERIOD = 86400000L;
/*  22 */   private static BackgroundThreadManager manager = null;
/*     */   private String filePath;
/*  26 */   private Timer changeCustomerPermissionTimer = null;
/*     */ 
/*  28 */   private Timer deleteCustomerTimer = null;
/*     */ 
/*     */   private BackgroundThreadManager()
/*     */   {
/*  32 */     this.changeCustomerPermissionTimer = new Timer();
/*     */ 
/*  36 */     this.deleteCustomerTimer = new Timer();
/*     */   }
/*     */ 
/*     */   public static BackgroundThreadManager getInstance(String filePath)
/*     */   {
/*  46 */     if (manager == null) {
/*  47 */       manager = new BackgroundThreadManager();
/*     */     }
/*  49 */     manager.filePath = filePath;
/*  50 */     return manager;
/*     */   }
/*     */ 
/*     */   public void stop()
/*     */   {
/*  57 */     this.changeCustomerPermissionTimer.cancel();
/*  58 */     this.changeCustomerPermissionTimer.purge();
/*     */ 
/*  63 */     this.deleteCustomerTimer.cancel();
/*  64 */     this.deleteCustomerTimer.purge();
/*     */   }
/*     */ 
/*     */   public void start()
/*     */   {
/*  71 */     String indexFilePath = this.filePath + File.separator + "lucene/";
/*     */ 
/*  80 */     this.changeCustomerPermissionTimer.schedule(
/*  81 */       new ChangeCustomerPermissionThread(indexFilePath), 
/*  82 */       Util.getTomorrowMorning2am(), 86400000L);
/*     */ 
/*  97 */     this.deleteCustomerTimer.schedule(new DeleteCustomerThread(
/*  98 */       indexFilePath), Util.getTomorrowMorning4am(), 86400000L);
/*     */ 
/* 101 */     new LuceneThread(indexFilePath, false).start();
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.thread.BackgroundThreadManager
 * JD-Core Version:    0.6.1
 */